create or replace view vac_app_page_da_action_4_1 as
with daa as
(
select
 workspace,
 workspace_display_name,
 application_id,
 application_name,
 page_id,
 page_name,
 dynamic_action_id,
 dynamic_action_name,
 action_name,
 action_code,
 to_char(action_sequence) action_sequence,
 dynamic_action_event_result,
 execute_on_page_init,
 affected_elements,
 affected_elements_type,
 affected_region,
 affected_region_id,
 attribute_01,
 attribute_02,
 attribute_03,
 attribute_04,
 attribute_05,
 attribute_06,
 attribute_07,
 attribute_08,
 attribute_09,
 attribute_10,
 attribute_11,
 attribute_12,
 attribute_13,
 attribute_14,
 attribute_15,
 stop_execution_on_error,
 last_updated_by,
 last_updated_on,
 component_comment,
 action_id
from apex_application_page_da_acts d
)
select
 workspace,
 workspace_display_name,
 application_id,
 application_name,
 page_id,
 page_name,
 dynamic_action_id,
 affected_region_id,
 action_sequence,
 dynamic_action_name,
 last_updated_by,
 last_updated_on,
 action_id,
 u_name,
 u_value,
 'APEX_APPLICATION_PAGE_DA_ACTS' src_view_name
from daa
 UNPIVOT INCLUDE NULLS
 ( u_value
   FOR    u_name
   IN
   (
     action_code,
     action_name,
     dynamic_action_event_result,
     execute_on_page_init,
     affected_elements,
     affected_elements_type,
     affected_region,
     attribute_01,
     attribute_02,
     attribute_03,
     attribute_04,
     attribute_05,
     attribute_06,
     attribute_07,
     attribute_08,
     attribute_09,
     attribute_10,
     attribute_11,
     attribute_12,
     attribute_13,
     attribute_14,
     attribute_15,
     stop_execution_on_error
   )
 );

